|
buttonr 2.2.0
|
API for configuring and manipulating Button R Click driver. More...
Topics | |
| Button R PWM Settings | |
| Settings for configuration of Button R Click driver. | |
| Button R MikroBUS Map | |
| MikroBUS pin mapping of Button R Click driver. | |
| Buttonr_cfg | |
Functions | |
| void | buttonr_cfg_setup (buttonr_cfg_t *cfg) |
| Button R configuration object setup function. | |
| err_t | buttonr_init (buttonr_t *ctx, buttonr_cfg_t *cfg) |
| Button R initialization function. | |
| err_t | buttonr_set_duty_cycle (buttonr_t *ctx, float duty_cycle) |
| Button R sets PWM duty cycle. | |
| err_t | buttonr_pwm_stop (buttonr_t *ctx) |
| Button R stop PWM module. | |
| err_t | buttonr_pwm_start (buttonr_t *ctx) |
| Button R start PWM module. | |
| uint8_t | buttonr_get_button_state (buttonr_t *ctx) |
| Button R get button state function. | |
API for configuring and manipulating Button R Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void buttonr_cfg_setup | ( | buttonr_cfg_t * | cfg | ) |
Button R configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See buttonr_cfg_t object definition for detailed explanation. |
| uint8_t buttonr_get_button_state | ( | buttonr_t * | ctx | ) |
Button R get button state function.
This function reads the digital signal from the INT pin which tells us whether the button has been pressed or not.
| [out] | ctx | : Click context object. See buttonr_t object definition for detailed explanation. |
See #err_t definition for detailed explanation.
| err_t buttonr_init | ( | buttonr_t * | ctx, |
| buttonr_cfg_t * | cfg ) |
Button R initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See buttonr_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See buttonr_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error.| err_t buttonr_pwm_start | ( | buttonr_t * | ctx | ) |
Button R start PWM module.
This function starts the PWM moudle output.
| [out] | ctx | : Click context object. See buttonr_t object definition for detailed explanation. |
0 - Success, -1 - Error.| err_t buttonr_pwm_stop | ( | buttonr_t * | ctx | ) |
Button R stop PWM module.
This function stops the PWM moudle output.
| [out] | ctx | : Click context object. See buttonr_t object definition for detailed explanation. |
0 - Success, -1 - Error.| err_t buttonr_set_duty_cycle | ( | buttonr_t * | ctx, |
| float | duty_cycle ) |
Button R sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
| [out] | ctx | : Click context object. See buttonr_t object definition for detailed explanation. |
| [in] | duty_ratio | : PWM duty_ratio. |
0 - Success, -1 - Error.